﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<IEnumerable<Sisocana.Core.Models.NoticiaAsociadaModel>>" %>

<script src="<%: Url.Content("~/Scripts/jquery-ui-1.8.11.js") %>" type="text/javascript"></script>
<link href="<%: Url.Content("~/Content/themes/base/jquery.ui.all.css") %>" rel="stylesheet" type="text/css" />

<script language="javascript" type="text/javascript">
        $(document).ready(function () {
            $("p a, input:submit,input:file ").button();
        });
</script>

<p>
    <%: Html.ActionLink("Create New", "createSources", new { id = ViewData["idSitio"] })%>
</p>
<%if (Model != null && Model.Count() != 0){ %>
<table>
    <tr>
        <th></th>
        <th>
            RSS Feed Name
        </th>
        <th>
            Number of items
        </th>
        <th>
            Search Tag
        </th>
        <th>
            Show summary?
        </th>
        <th>
            Logo
        </th>
    </tr>

<% foreach (var item in Model) { %>
    <tr>
        <td>
            <%--<%: Html.ActionLink("Edit", "EditSource", new { id=item.id }) %> |
            <%: Html.ActionLink("Delete", "DeleteSource", new { id=item.id }) %> |--%>

            <%= Html.MakeImgLink(Url.Action("EditSource", "Site", new { id = item.id}),"Edit" ,"edit.png")%> |
            <%= Html.MakeImgLink(Url.Action("DeleteSource", "Site", new { id = item.id }),"Delete" ,"delete.png")%>
        </td>
        <td>
            <%: Html.DisplayFor(modelItem => item.NoticiaNombre) %>
        </td>
        <td>
            <%: Html.DisplayFor(modelItem => item.cantVisualizar) %>
        </td>
        <td>
            <%: Html.DisplayFor(modelItem => item.tagBusqueda) %>
        </td>
        <td>
            <%: Html.DisplayFor(modelItem => item.showDesc) %>
        </td>
        <td>
        <% if (item.logoURL != null)
            { %>
            <img alt="logo" height="20px" width"20px" src='<%= item.logoURL %>' />
        <%} %>
        </td>

    </tr>
<% } %>

</table>
<% } %>

